<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<s:head theme="ajax"/>
<style type="text/css">
hr {
	margin-bottom: 0px;
	margin-top: 0px;
}
#lmtab{
	font-size: small;	
	border-spacing: 0px;
	border-collapse: collapse;
	border-color: rgb(242, 242, 242);
}
</style>
</head>
<body>
	<center>
			<table border="0" width="800">
			<tr>
				<td align="left">
					<s:url id="prevMURL" action="listmonth" namespace="/commute">
						<s:param name="smonth">
							<s:date name="prevmonth" format="yyyy-MM"/>
						</s:param>
					</s:url>
					<s:a href="%{prevMURL}" theme="ajax" targets="commcon">
						<s:date name="prevmonth" format="yyyy-MM"/>
					</s:a>
					&nbsp;◀&nbsp;
					<s:date name="tomonth" format="yyyy-MM"/>
					&nbsp;▶&nbsp;
					<s:url id="nextMURL" action="listmonth" namespace="/commute">
						<s:param name="smonth">
							<s:date name="nextmonth" format="yyyy-MM"/>
						</s:param>
					</s:url>					
					<s:a href="%{nextMURL}" theme="ajax" targets="commcon">
						<s:date name="nextmonth" format="yyyy-MM"/>
					</s:a>
					&nbsp;
					<s:url id="tomonthMURL" action="listmonth" namespace="/commute">
						<s:param name="smonth" value="newd"/>
					</s:url>											
					<s:a href="%{tomonthMURL}" theme="ajax" targets="commcon">
						<img src="/ssteam/image/commute/butt_month.png" border="0" align="middle">
					</s:a>
				</td>
			</tr>
		</table>
		<br>
		<hr color="#5B8ED9" width="800">
		<table border="1" width="800" id="lmtab">		
			<tr>							
				<th align="center" width="7%">사번</th>				
				<c:forEach var="i" begin="1" end="${endday }" step="1">
				<th width="3%">${i }</th>
				</c:forEach>						
			</tr>
			<%--
				2중 iterator
				세로로는 사번, 가로로는 사번별 월 출퇴근 기록 출력 
			--%>
			<s:iterator id="lstm" value="listm" status="lststt">
			<tr onmouseover="this.style.backgroundColor='#eaf0fa'" onmouseout="this.style.backgroundColor=''">
				<%--사번별로 최초1회는 사번을 출력 --%>
				<td><s:property value="%{listm.get(#lststt.index).get(1).sabun}"/></td>
				<s:iterator id="cmlst" value="lstm">				
				<td valign="top" height="21">
					<font style="font-size: xx-small;">
					<s:date name="cwork" format="HH:mm"/>
					<br>
					<s:date name="lwork" format="HH:mm"/>
					</font>	
				</td>
				</s:iterator>									
			</tr>
			</s:iterator>			
		</table>		
		<table border="0" width="800">
			<tr>
				<td width="50%" align="right">
					<c:forEach begin="1" end="${totalpage }" step="1" var="i">						
						<s:url id="commPageURL" action="listmonth" namespace="/commute">						
							<s:param name="sabun">${session.user.sabun }</s:param>
							<s:param name="curpage">${i }</s:param>
						</s:url>						
						<c:choose>
							<c:when test="${curpage == i }">
								<font color="black">[${i }]&nbsp;</font>
							</c:when>
							<c:otherwise>
								<s:a href="%{commPageURL}" theme="ajax" targets="commcon">
								[${i }]
								</s:a>
								&nbsp;
							</c:otherwise>
						</c:choose>							
					</c:forEach>					
				</td>
				<td width="50%" align="left">
					${curpage } / ${totalpage } 페이지
				</td>
			</tr>
		</table>
	</center>
</body>
</html>